--数据层 M
--负责数据管理
Model = {}
local self = Model
self.models = {}

function self:Init()
    self:Invoke("Init")
end

function self:UnInit()
    self:Invoke("UnInit")
end


function self:Register(model)
    table.insert(self.models, model)
end

function self:Invoke(funcname,args)
    local t_func = nil
    for i,model in ipairs(self.models) do
        t_func = model[funcname]
        if t_func then 
            t_func(model,args)
        end
    end
end

return self
